Skip to content

Conversation

@LLKruczek
Copy link
Collaborator

@LLKruczek LLKruczek commented Nov 12, 2025

@LLKruczek LLKruczek requested a review from lucaspar November 12, 2025 00:12
@lucaspar lucaspar added feature New feature or request gateway Gateway component javascript Pull requests that update non-trivial javascript code migrations Code changes that require data or schema migrations in the database. labels Nov 12, 2025
@lucaspar lucaspar mentioned this pull request Nov 12, 2025
@LLKruczek LLKruczek force-pushed the add-dataset-keywords-model branch 2 times, most recently from 2b17bdf to 35c9ef5 Compare December 2, 2025 15:08
@lucaspar lucaspar requested a review from Copilot December 3, 2025 18:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new Keyword model to enable searchable, reusable keywords for datasets, replacing the previous TextField-based approach with a proper many-to-many relationship. The implementation includes autocomplete functionality for better user experience and proper query optimization.

Key changes:

  • Introduces a new Keyword model with ManyToMany relationship to Dataset, using a custom KeywordNameField that auto-slugifies keyword names
  • Adds keyword autocomplete API endpoint with frontend JavaScript implementation for real-time suggestions
  • Migrates logging from standard logging module to loguru throughout the views

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
gateway/sds_gateway/api_methods/models.py Added Keyword model with custom KeywordNameField for auto-slugification; removed keywords TextField from Dataset model
gateway/sds_gateway/api_methods/tests/factories.py Added post-generation hook for creating Keyword instances in DatasetFactory
gateway/sds_gateway/api_methods/serializers/dataset_serializers.py Added keywords field to DatasetGetSerializer to return keyword names
gateway/sds_gateway/api_methods/admin.py Registered Keyword model in admin and added keyword display to DatasetAdmin
gateway/sds_gateway/users/views.py Added KeywordAutocompleteAPIView; updated dataset create/update logic to handle keyword associations; migrated from logging to loguru
gateway/sds_gateway/users/urls.py Added URL route for keyword autocomplete API endpoint
gateway/sds_gateway/users/forms.py Added keywords field to DatasetInfoForm with cleaning/normalization logic
gateway/sds_gateway/templates/users/partials/step_1.html Added keywords input field to dataset creation form
gateway/sds_gateway/templates/users/partials/review_create_dataset.html Added keywords display section to review step
gateway/sds_gateway/templates/users/partials/dataset_details_modal.html Added keywords section to dataset details modal
gateway/sds_gateway/templates/users/group_captures.html Implemented KeywordAutocomplete JavaScript class for autocomplete functionality
gateway/sds_gateway/static/js/deprecated/datasetDetailsModal.js Added keyword rendering with badge styling to populate dataset modal
gateway/sds_gateway/static/js/captureGroupingComponents.js Added keyword display handling in form handler and dataset review step
gateway/sds_gateway/static/js/deprecated/captureGroupingComponents.js Added keyword display and X-Requested-With header
gateway/sds_gateway/static/js/actions/DetailsActionManager.js Added updateKeywords method to render keywords with badges in dataset details modal
gateway/sds_gateway/api_methods/migrations/max_migration.txt Updated migration marker to reflect new Keyword model migration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

	modified:   gateway/sds_gateway/api_methods/admin.py
	modified:   gateway/sds_gateway/api_methods/migrations/max_migration.txt
	modified:   gateway/sds_gateway/api_methods/models.py
	modified:   gateway/sds_gateway/api_methods/serializers/dataset_serializers.py
	new file:   gateway/sds_gateway/static/js/captureGroupingComponents.js
	modified:   gateway/sds_gateway/static/js/deprecated/captureGroupingComponents.js
	modified:   gateway/sds_gateway/static/js/deprecated/datasetDetailsModal.js
	modified:   gateway/sds_gateway/templates/users/group_captures.html
	modified:   gateway/sds_gateway/templates/users/partials/dataset_details_modal.html
	modified:   gateway/sds_gateway/templates/users/partials/review_create_dataset.html
	modified:   gateway/sds_gateway/users/forms.py
	modified:   gateway/sds_gateway/users/urls.py
	modified:   gateway/sds_gateway/users/views.py
@LLKruczek LLKruczek force-pushed the add-dataset-keywords-model branch from 35c9ef5 to 350d49d Compare December 4, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request gateway Gateway component javascript Pull requests that update non-trivial javascript code migrations Code changes that require data or schema migrations in the database.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants